using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Admin;
using System;
using System.Data;
using System.Text;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Xml;
public class HL_Admin_admin_lablePa : Admin, IRequiresSessionState
{
	protected ScriptManager ScriptManager1;
	protected Literal JsParm;
	protected Literal Label_LabelName;
	protected Literal listParamter;
	protected Panel UserLabel;
	protected Literal LabelTypeName;
	protected TextBox LabelName;
	protected TextBox IDArray;
	protected TextBox KeyValue;
	protected DropDownList OtherType;
	protected DropDownList SortType;
	protected CheckBoxList ProductType;
	protected DropDownList IsNew;
	protected TextBox StrartPrice;
	protected TextBox EndPrice;
	protected Panel Product_Condition_Panel;
	protected CheckBoxList Shop_ShopType;
	protected Panel Shop_Condition_Panel;
	protected DropDownList Article_ArticleType;
	protected DropDownList Article_LinkType;
	protected TextBox Articel_ArticleBegin;
	protected TextBox Article_ArticleEnd;
	protected Panel Article_Conditon_Panel;
	protected DropDownList ClassID;
	protected Shop_UserControls_HowaveProvinceCity HowaveProvinceCity1;
	protected DropDownList ProductImgType;
	protected Panel Product_Panel;
	protected DropDownList Article_TitleType;
	protected RadioButtonList Article_Summary;
	protected DropDownList Article_SummarySet;
	protected TextBox Article_SummaryLimit;
	protected Panel Article_Panel;
	protected DropDownList ShowUIType;
	protected TextBox ShowNum;
	protected TextBox TitleLength;
	protected CheckBoxList ShowField;
	protected DropDownList FrontIcon;
	protected DropDownList ShowFlag;
	protected DropDownList OpenType;
	protected TextBox StyleName;
	protected DropDownList AutoUpdate;
	protected TextBox CacheTime;
	protected Button PreviewLabelButton;
	protected Button SubmitLabelButton;
	protected Literal LabelPreviewContent;
	protected Panel LabelPreviewPanel;
	protected PlaceHolder SysLabel_PlaceHolder;
	protected Shop_UserControls_ShowArticle article_1;
	protected Shop_UserControls_ShowProduct product_1;
	protected Shop_UserControls_ShowShop shop_1;
	protected HtmlForm form1;
	public string LabelNamestr = "";
	public string[] textArray = new string[]
	{
		"LabelName",
		"IDArray",
		"KeyValue",
		"StyleName",
		"CacheTime",
		"TitleLength",
		"ShowNum"
	};
	public string[] selectArray = new string[]
	{
		"ClassID",
		"OtherType",
		"SortType",
		"ShowUIType",
		"FrontIcon",
		"ShowFlag",
		"OpenType",
		"AutoUpdate"
	};
	public string[] checkArray = new string[]
	{
		"ShowField"
	};
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			this.LabelNamestr = base.Request["n"];
			if (this.LabelNamestr == "")
			{
				base.Response.Write("找不到标签！");
				base.Response.End();
			}
			this.Label_LabelName.Text = this.LabelNamestr;
			this.InitPage();
		}
	}
	protected void InitPage()
	{
		string[] array = new string[]
		{
			""
		};
		string[] valueArray = new string[]
		{
			""
		};
		string[] array2 = new string[]
		{
			""
		};
		string[] valueArray2 = new string[]
		{
			""
		};
		string[] array3 = new string[]
		{
			""
		};
		string[] valueArray3 = new string[]
		{
			""
		};
		bool flag = false;
		if (base.Request["action"] == "modify")
		{
			flag = true;
			this.BindTextBoxParm(this.textArray);
			this.BindSelectParm(this.selectArray);
			this.BindCheckBoxListParm(this.checkArray);
		}
		string labelNamestr = this.LabelNamestr;
		if (labelNamestr != null)
		{
			if (labelNamestr == "ShowProduct")
			{
				this.LabelTypeName.Text = "商品列表标签";
				this.Product_Condition_Panel.Visible = true;
				this.Product_Panel.Visible = true;
				array = new string[]
				{
					"商品类型（ProductType）",
					"商品价格（ProductPrice）",
					"卖家名称（ShopOwnerName）",
					"所在地（ProductPlace）",
					"剩余时间（LeftTime）",
					"点击数（Hits）",
					"库存（Stocks）",
					"参考价（MarketPrice）"
				};
				valueArray = new string[]
				{
					"ProductType",
					"ProductPrice",
					"ShopOwnerName",
					"ProductPlace",
					"LeftTime",
					"Hits",
					"Stocks",
					"MarketPrice"
				};
				array2 = new string[]
				{
					"按商品ID从高到低",
					"按商品ID从低到高",
					"价格从低到高",
					"价格从高到低",
					"时间从小到多",
					"时间从多到小",
					"卖家信用从高到低",
					"卖家信用从低到高",
					"浏览量从高到低",
					"浏览量从低到高"
				};
				valueArray2 = new string[]
				{
					"10",
					"9",
					"1",
					"2",
					"3",
					"4",
					"5",
					"6",
					"7",
					"8"
				};
				array3 = new string[]
				{
					"不限",
					"热门商品",
					"推荐商品",
					"集市商品",
					"品牌店商品",
					"打折商品",
					"最新成交商品",
					"带视频商品"
				};
				valueArray3 = new string[]
				{
					"all",
					"hot",
					"recommend",
					"common",
					"band",
					"discount",
					"order",
					"video"
				};
				goto IL_8DF;
			}
			if (labelNamestr == "ShowShop")
			{
				this.LabelTypeName.Text = "店铺列表标签";
				this.Shop_Condition_Panel.Visible = true;
				array = new string[]
				{
					"店长名（ShopOwnerName）",
					"店铺简介（ShopIntro）",
					"店铺公告",
					"所在地（ShopPlace）",
					"店铺商品数（ShopProductNum）",
					"主营项目（ShopOperatorItem）",
					"开店时间（ShopRegDate）",
					"店铺信誉（SalerCrediet）",
					"OICQ（OICQ）",
					"淘宝旺旺（Taobaowangwang）"
				};
				valueArray = new string[]
				{
					"ShopOwnerName",
					"ShopIntro",
					"ShopAnnouncement",
					"ShopPlace",
					"ShopProductNum",
					"ShopOperatorItem",
					"ShopRegDate",
					"SalerCrediet",
					"OICQ",
					"Taobaowangwang"
				};
				array2 = new string[]
				{
					"按店铺ID从低到高",
					"按店铺ID从高到低",
					"注册时间从前到后",
					"注册时间从后到前",
					"店铺等级从低到高",
					"店铺等级从高到低",
					"浏览量从低到高",
					"浏览量从高到低",
					"卖家信用从低到高",
					"卖家信用从高到低"
				};
				valueArray2 = new string[]
				{
					"1",
					"2",
					"3",
					"4",
					"5",
					"6",
					"7",
					"8",
					"9",
					"10"
				};
				array3 = new string[]
				{
					"不限",
					"精品店铺"
				};
				valueArray3 = new string[]
				{
					"",
					"recommend"
				};
				goto IL_8DF;
			}
			if (labelNamestr == "ShowArticle")
			{
				this.LabelTypeName.Text = "文章列表标签";
				this.Article_Conditon_Panel.Visible = true;
				this.Article_Panel.Visible = true;
				Shop_Module shop_Module = new Shop_Module(this.conn);
				DataTable allModule = shop_Module.GetAllModule();
				this.Article_ArticleType.DataSource = allModule;
				this.Article_ArticleType.DataTextField = "title";
				this.Article_ArticleType.DataValueField = "id";
				this.Article_ArticleType.DataBind();
				array = new string[]
				{
					"作者（Editor）",
					"录入时间（InputTime）",
					"修改时间（UpdateTime）",
					"点击数（Hits）"
				};
				valueArray = new string[]
				{
					"Editor",
					"InputTime",
					"UpdateTime",
					"Hits"
				};
				array2 = new string[]
				{
					"按文章ID从高到低",
					"按文章ID从低到高",
					"文章发表时间从近到远",
					"文章发表时间从远到近",
					"文章更新时间从近到远",
					"文章更新时间从远到近",
					"浏览量从高到低",
					"浏览量从低到高"
				};
				valueArray2 = new string[]
				{
					"1",
					"2",
					"3",
					"4",
					"5",
					"6",
					"7",
					"8"
				};
				array3 = new string[]
				{
					"不限",
					"置顶",
					"推荐"
				};
				valueArray3 = new string[]
				{
					"",
					"OnTop",
					"Elite"
				};
				goto IL_8DF;
			}
		}
		this.UserLabel.Visible = true;
		this.SysLabel_PlaceHolder.Visible = false;
		this.listParamter.Text = this.listParameter("list");
		this.JsParm.Text = this.listParameter("get");
		IL_8DF:
		Shop_Class shop_Class = new Shop_Class(this.conn);
		shop_Class.BindDropDownListClassMapPath(this.ClassID);
		this.FrontIcon.Attributes.Add("onchange", "ShowFlagPreview('show_frontIcon',this.value)");
		for (int i = 1; i < 19; i++)
		{
			this.FrontIcon.Items.Add(new ListItem("小图片样式" + i.ToString(), "style_" + i.ToString() + ".gif"));
		}
		this.InitDropDownList(this.SortType, array2, valueArray2);
		this.InitDropDownList(this.OtherType, array3, valueArray3);
		this.InitCheckBoxList(this.ShowField, array, valueArray);
		ShopGroupBll shopGroupBll = new ShopGroupBll(this.conn);
		this.Shop_ShopType.DataSource = shopGroupBll.GetGroups();
		this.Shop_ShopType.DataBind();
		if (flag)
		{
			this.BindTextBoxParm(this.textArray);
			this.BindSelectParm(this.selectArray);
			this.BindCheckBoxListParm(this.checkArray);
			labelNamestr = this.LabelNamestr;
			if (labelNamestr != null)
			{
				if (!(labelNamestr == "ShowArticle"))
				{
					if (!(labelNamestr == "ShowProduct"))
					{
						if (labelNamestr == "ShowShop")
						{
							this.ShowShop_BandParm();
						}
					}
					else
					{
						this.ShopProduct_BandParm();
					}
				}
				else
				{
					this.ShowArticle_BandParm();
				}
			}
		}
	}
	protected void InitDropDownList(DropDownList ddl, string[] textArray, string[] ValueArray)
	{
		for (int i = 0; i < textArray.Length; i++)
		{
			ListItem item = new ListItem(textArray[i], ValueArray[i]);
			ddl.Items.Add(item);
		}
	}
	protected void InitCheckBoxList(CheckBoxList cbl, string[] textArray, string[] ValueArray)
	{
		for (int i = 0; i < textArray.Length; i++)
		{
			ListItem item = new ListItem(textArray[i], ValueArray[i]);
			cbl.Items.Add(item);
		}
	}
	protected void BindTextBoxParm(string[] textArray)
	{
		for (int i = 0; i < textArray.Length; i++)
		{
			string text = textArray[i];
			if (base.Request[text] != null && base.Request[text] != "")
			{
				TextBox textBox = (TextBox)this.Page.FindControl(text);
				if (textBox != null)
				{
					textBox.Text = base.Request[text];
				}
			}
		}
	}
	protected void BindSelectParm(string[] selectArray)
	{
		for (int i = 0; i < selectArray.Length; i++)
		{
			string text = selectArray[i];
			if (base.Request[text] != null && base.Request[text] != "")
			{
				DropDownList dropDownList = (DropDownList)this.Page.FindControl(text);
				if (dropDownList != null)
				{
					dropDownList.SelectedValue = base.Request[text];
				}
			}
		}
	}
	protected void BindCheckBoxListParm(string[] checkArray)
	{
		for (int i = 0; i < checkArray.Length; i++)
		{
			string text = checkArray[i];
			if (base.Request[text] != null && base.Request[text] != "")
			{
				CheckBoxList checkBoxList = (CheckBoxList)this.Page.FindControl(text);
				if (checkBoxList != null)
				{
					string[] array = base.Request[text].Split(new char[]
					{
						'|'
					});
					string[] array2 = array;
					for (int j = 0; j < array2.Length; j++)
					{
						string b = array2[j];
						foreach (ListItem listItem in checkBoxList.Items)
						{
							if (listItem.Value == b)
							{
								listItem.Selected = true;
								break;
							}
						}
					}
				}
			}
		}
	}
	protected void ShopProduct_BandParm()
	{
		CheckBoxList checkBoxList = (CheckBoxList)this.Page.FindControl("ProductType");
		if (checkBoxList != null)
		{
			if (base.Request["StandPrice"] == "1")
			{
				checkBoxList.Items[0].Selected = true;
			}
			if (base.Request["Auction"] == "1")
			{
				checkBoxList.Items[1].Selected = true;
			}
			if (base.Request["TeamBuy"] == "1")
			{
				checkBoxList.Items[2].Selected = true;
			}
			if (base.Request["PromoteBuy"] == "1")
			{
				checkBoxList.Items[3].Selected = true;
			}
		}
		string[] array = new string[]
		{
			"ProductImgType"
		};
		string[] array2 = new string[]
		{
			"StrartPrice",
			"EndPrice"
		};
		this.BindSelectParm(array);
		this.BindTextBoxParm(array2);
	}
	protected void ShowArticle_BandParm()
	{
		if (base.Request["Summary"] != null && base.Request["Summary"] != "" && base.Request["Summary"].Contains("|"))
		{
			this.Article_Summary.SelectedValue = "1";
			string[] array = base.Request["Summary"].Split(new char[]
			{
				'|'
			});
			this.Article_SummarySet.SelectedValue = array[0];
			this.Article_SummaryLimit.Text = array[1];
		}
		if (base.Request["ArticleType"] != null)
		{
			this.Article_ArticleType.SelectedValue = base.Request["ArticleType"];
		}
	}
	protected void ShowShop_BandParm()
	{
		if (base.Request["CommondShop"] != null && base.Request["CommondShop"] == "1")
		{
			this.Shop_ShopType.Items[0].Selected = true;
		}
		if (base.Request["SeniorShop"] != null && base.Request["SeniorShop"] == "1")
		{
			this.Shop_ShopType.Items[1].Selected = true;
		}
		if (base.Request["BandShop"] != null && base.Request["BandShop"] == "1")
		{
			this.Shop_ShopType.Items[2].Selected = true;
		}
	}
	public string listParameter(string action)
	{
		StringBuilder stringBuilder = new StringBuilder();
		LabelBll labelBll = new LabelBll(this.conn);
		DataTable labelByLabelName = labelBll.GetLabelByLabelName(this.LabelNamestr);
		string result;
		if (labelByLabelName.Rows.Count <= 0)
		{
			result = "找不到标签！可能已被删除！";
		}
		else
		{
			string text = labelByLabelName.Rows[0]["Define"].ToString();
			if (text == null || text == "")
			{
				result = "错误的标签！";
			}
			else
			{
				XmlDocument xmlDocument = new XmlDocument();
				xmlDocument.LoadXml(text);
				XmlNodeList xmlNodeList = xmlDocument.SelectNodes("root/parms");
				if (xmlNodeList != null)
				{
					foreach (XmlNode xmlNode in xmlNodeList)
					{
						XmlNode xmlNode2 = xmlNode.SelectSingleNode("name");
						XmlNode xmlNode3 = xmlNode.SelectSingleNode("intro");
						if (xmlNode2 == null || xmlNode3 == null)
						{
							result = "错误的标签参数！";
							return result;
						}
						if (action == "get")
						{
							stringBuilder.Append("if (document.getElementById(\"" + xmlNode2.InnerXml + "\").value != \"\")\n");
							stringBuilder.Append("{\n");
							stringBuilder.Append(string.Concat(new string[]
							{
								"    labelText = labelText + \" ",
								xmlNode2.InnerXml,
								"=\\\"\" + document.getElementById(\"",
								xmlNode2.InnerXml,
								"\").value + \"\\\"\";\n"
							}));
							stringBuilder.Append("}\n");
						}
						else
						{
							if (action == "list")
							{
								stringBuilder.Append("<div style=\"width:100%;\">\n");
								stringBuilder.Append("    <div style=\"float:left; width:40%; text-align:right; line-height:25px;\">" + xmlNode3.InnerXml + "：</div>\n");
								stringBuilder.Append(string.Concat(new string[]
								{
									"    <div style=\"float:left;\"><input id=\"",
									xmlNode2.InnerXml,
									"\" name=\"",
									xmlNode2.InnerXml,
									"\"/></div>\n"
								}));
								stringBuilder.Append("</div>\n");
							}
						}
					}
				}
				XmlNode xmlNode4 = xmlDocument.SelectSingleNode("/root/EnablePage");
				if (xmlNode4 != null)
				{
					string innerXml = xmlNode4.InnerXml;
					if (innerXml == "1")
					{
						if (action == "get")
						{
							stringBuilder.Append("if (document.getElementById(\"MaxPerPage\").value != \"\")\n");
							stringBuilder.Append("{\n");
							stringBuilder.Append("    labelText = labelText + \" MaxPerPage=\\\"\" + document.getElementById(\"MaxPerPage\").value + \"\\\"\";\n");
							stringBuilder.Append("}\n");
						}
						else
						{
							if (action == "list")
							{
								stringBuilder.Append("<div style=\"width:100%;\">\n");
								stringBuilder.Append("    <div style=\"float:left; width:40%; text-align:right; line-height:25px;\">每页显示数：</div>\n");
								stringBuilder.Append("    <div style=\"float:left;\"><input id=\"MaxPerPage\" name=\"MaxPerPage\"/></div>\n");
								stringBuilder.Append("</div>\n");
							}
						}
					}
				}
				result = stringBuilder.ToString();
			}
		}
		return result;
	}
	protected void PreviewLabelButton_Click(object sender, EventArgs e)
	{
		string text = base.Request["n"];
		if (text != null)
		{
			if (!(text == "ShowProduct"))
			{
				if (!(text == "ShowShop"))
				{
					if (text == "ShowArticle")
					{
						this.ArticlePreview();
					}
				}
				else
				{
					this.ShopPreview();
				}
			}
			else
			{
				this.ProductPreview();
			}
		}
	}
	protected void SubmitLabelButton_Click(object sender, EventArgs e)
	{
		string text = DateTime.Now.ToString("yyyyMMddhhmmss");
		StringBuilder stringBuilder = new StringBuilder();
		string text2 = base.Request["n"];
		stringBuilder.Append(string.Concat(new string[]
		{
			"<hl:",
			text2,
			" ID=\"",
			text2,
			text.ToString(),
			"\" "
		}));
		if (this.LabelName.Text != "")
		{
			stringBuilder.Append("LabelName=\"" + this.LabelName.Text + "\"  ");
		}
		stringBuilder.Append("ShowUIType=\"" + this.ShowUIType.SelectedValue + "\"  ");
		stringBuilder.Append("OpenType=\"" + this.OpenType.SelectedValue + "\"  ");
		if (this.ShowNum.Text != "")
		{
			stringBuilder.Append("ShowNum=\"" + this.ShowNum.Text + "\"  ");
		}
		if (this.StyleName.Text != "" && this.StyleName.Text != null)
		{
			stringBuilder.Append("StyleName=\"" + this.StyleName.Text + "\"  ");
		}
		if (!(base.Request["selectType"] == "designateID") || !(this.IDArray.Text != ""))
		{
			if (this.ShowFlag.SelectedValue != "none")
			{
				stringBuilder.Append("ShowFlag=\"" + this.ShowFlag.SelectedValue + "\"  ");
			}
			if (this.KeyValue.Text != "" && this.KeyValue.Text != null)
			{
				stringBuilder.Append("KeyValue=\"" + this.KeyValue.Text + "\"  ");
			}
			DropDownList dropDownList = (DropDownList)this.HowaveProvinceCity1.FindControl("Province");
			DropDownList dropDownList2 = (DropDownList)this.HowaveProvinceCity1.FindControl("City");
			string text3 = "";
			if (dropDownList.SelectedIndex != 0)
			{
				text3 += dropDownList.SelectedValue;
			}
			if (dropDownList2.SelectedIndex != 0)
			{
				text3 += dropDownList2.SelectedValue;
			}
			if (text3 != "")
			{
				stringBuilder.Append("ProductPlace=\"" + dropDownList2.SelectedValue + "\"  ");
				stringBuilder.Append("Product=\"" + dropDownList.SelectedValue + "\"  ");
			}
			stringBuilder.Append("ClassID=\"" + this.ClassID.SelectedValue + "\"  ");
			stringBuilder.Append("SortType=\"" + this.SortType.SelectedValue + "\"  ");
		}
		if (this.FrontIcon.SelectedValue != "")
		{
			stringBuilder.Append("FrontIcon=\"" + this.FrontIcon.SelectedValue + "\" ");
		}
		stringBuilder.Append("TitleLength=\"" + this.TitleLength.Text + "\" ");
		string text4 = "";
		foreach (ListItem listItem in this.ShowField.Items)
		{
			if (listItem.Selected)
			{
				text4 = text4 + listItem.Value + "|";
			}
		}
		if (text4.Contains("|"))
		{
			text4 = text4.Remove(text4.Length - 1);
		}
		stringBuilder.Append("ShowField=\"" + text4 + "\" ");
		if (this.AutoUpdate.SelectedValue == "true" && this.CacheTime.Text != "" && Text.IsNumber(this.CacheTime.Text))
		{
			stringBuilder.Append("AutoUpdate=\"true\" ");
			stringBuilder.Append("CacheTime=\"" + this.CacheTime.Text + "\" ");
		}
		stringBuilder.Append("OtherType=\"" + this.OtherType.SelectedValue + "\" ");
		string text5 = text2;
		if (text5 != null)
		{
			if (!(text5 == "ShowProduct"))
			{
				if (!(text5 == "ShowShop"))
				{
					if (text5 == "ShowArticle")
					{
						stringBuilder.Append(this.GetArticleLabel());
					}
				}
				else
				{
					stringBuilder.Append(this.GetShopLabel());
				}
			}
			else
			{
				stringBuilder.Append(this.GetProductLabel());
			}
		}
		stringBuilder.Append(" runat=\"server\" />");
		base.Response.Write("<script type=\"text/javascript\"> window.returnValue ='" + stringBuilder.ToString() + "';window.close();</script>");
	}
	protected string GetProductLabel()
	{
		StringBuilder stringBuilder = new StringBuilder();
		string text = "1";
		string text2 = "1";
		if (this.IsNew.SelectedValue == "new")
		{
			text2 = "0";
		}
		else
		{
			if (this.IsNew.SelectedValue == "secondhand")
			{
				text = "0";
			}
		}
		string text3 = "0";
		string text4 = "0";
		string text5 = "0";
		string text6 = "0";
		foreach (ListItem listItem in this.ProductType.Items)
		{
			if (listItem.Selected)
			{
				string value = listItem.Value;
				if (value != null)
				{
					if (!(value == "1"))
					{
						if (!(value == "3"))
						{
							if (!(value == "2"))
							{
								if (value == "4")
								{
									text6 = "1";
								}
							}
							else
							{
								text4 = "1";
							}
						}
						else
						{
							text5 = "1";
						}
					}
					else
					{
						text3 = "1";
					}
				}
			}
		}
		stringBuilder.Append("ProductImgType=\"" + this.ProductImgType.SelectedValue + "\"  ");
		if (base.Request["selectType"] == "designateID" && this.IDArray.Text != "")
		{
			stringBuilder.Append("ProductIDArray=\"" + this.IDArray.Text + "\"  ");
		}
		else
		{
			if (text3 == "1")
			{
				stringBuilder.Append("StandPrice=\"" + text3 + "\"  ");
			}
			if (text4 == "1")
			{
				stringBuilder.Append("Auction=\"" + text4 + "\"  ");
			}
			if (text5 == "1")
			{
				stringBuilder.Append("TeamBuy=\"" + text5 + "\"  ");
			}
			if (text6 == "1")
			{
				stringBuilder.Append("PromoteBuy=\"" + text6 + "\"  ");
			}
			if (text == "1")
			{
				stringBuilder.Append("IsNew=\"" + text + "\"  ");
			}
			if (text2 == "1")
			{
				stringBuilder.Append("SecondHand=\"" + text2 + "\" ");
			}
			if (this.StrartPrice.Text != "" && this.StrartPrice.Text != null)
			{
				stringBuilder.Append("StartPrice=\"" + this.StrartPrice.Text + "\" ");
			}
			if (this.EndPrice.Text != "" && this.EndPrice.Text != null)
			{
				stringBuilder.Append("EndPrice=\"" + this.EndPrice.Text + "\" ");
			}
		}
		return stringBuilder.ToString();
	}
	protected string GetShopLabel()
	{
		StringBuilder stringBuilder = new StringBuilder();
		string text = "";
		foreach (ListItem listItem in this.Shop_ShopType.Items)
		{
			if (listItem.Selected)
			{
				text = text + listItem.Value + ",";
			}
		}
		if (text.Length >= 2)
		{
			text = text.Remove(text.Length - 1);
		}
		stringBuilder.Append("CommondShop=\"" + text + "\"  ");
		return stringBuilder.ToString();
	}
	protected string GetArticleLabel()
	{
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.Append("TitleType=\"" + this.Article_TitleType.SelectedValue + "\" ");
		stringBuilder.Append("LinkType=\"" + this.Article_LinkType.SelectedValue + "\" ");
		stringBuilder.Append("ArticleType=\"" + this.Article_ArticleType.SelectedValue + "\" ");
		if (this.Article_Summary.SelectedValue == "1")
		{
			stringBuilder.Append(string.Concat(new string[]
			{
				"Summary=\"",
				this.Article_SummarySet.SelectedValue,
				"|",
				this.Article_SummaryLimit.Text,
				"\" "
			}));
		}
		if (this.Articel_ArticleBegin.Text != "")
		{
			try
			{
				DateTime dateTime = Convert.ToDateTime(this.Articel_ArticleBegin.Text);
				stringBuilder.Append("ArticleBegin=\"" + this.Articel_ArticleBegin.Text + "\" ");
			}
			catch
			{
			}
		}
		if (this.Article_ArticleEnd.Text != "")
		{
			try
			{
				DateTime dateTime2 = Convert.ToDateTime(this.Article_ArticleEnd.Text);
				stringBuilder.Append("ArticleEnd=\"" + this.Article_ArticleEnd.Text + "\" ");
			}
			catch
			{
			}
		}
		return stringBuilder.ToString();
	}
	protected void ArticlePreview()
	{
		Shop_UserControls_ShowArticle shop_UserControls_ShowArticle = new Shop_UserControls_ShowArticle();
		shop_UserControls_ShowArticle.ClassID = this.ClassID.SelectedValue;
		shop_UserControls_ShowArticle.FrontIcon = this.FrontIcon.SelectedValue;
		shop_UserControls_ShowArticle.LinkType = int.Parse(this.Article_LinkType.SelectedValue);
		shop_UserControls_ShowArticle.OtherType = this.OtherType.SelectedValue;
		shop_UserControls_ShowArticle.ShowFlag = this.ShowFlag.SelectedValue;
		shop_UserControls_ShowArticle.ShowUIType = this.ShowUIType.SelectedValue;
		shop_UserControls_ShowArticle.SortType = int.Parse(this.SortType.SelectedValue);
		shop_UserControls_ShowArticle.ArticleType = this.Article_ArticleType.SelectedValue;
		if (this.ShowNum.Text != null && this.ShowNum.Text != "")
		{
			shop_UserControls_ShowArticle.ShowNum = int.Parse(this.ShowNum.Text);
		}
		if (this.Article_Summary.SelectedValue == "true")
		{
			shop_UserControls_ShowArticle.Summary = this.Article_SummarySet.SelectedValue + "|" + this.Article_SummaryLimit.Text;
		}
		if (this.TitleLength.Text != null && this.TitleLength.Text != "")
		{
			shop_UserControls_ShowArticle.TitleLength = int.Parse(this.TitleLength.Text);
		}
		string text = "";
		foreach (ListItem listItem in this.ShowField.Items)
		{
			if (listItem.Selected)
			{
				text = text + listItem.Value + "|";
			}
		}
		if (text.Contains("|"))
		{
			text = text.Remove(text.Length - 1);
		}
		shop_UserControls_ShowArticle.ShowField = text;
		this.LabelPreviewContent.Text = shop_UserControls_ShowArticle.GetStrFromControl();
		this.LabelPreviewPanel.Visible = true;
	}
	protected void ShopPreview()
	{
		Shop_UserControls_ShowShop shop_UserControls_ShowShop = new Shop_UserControls_ShowShop();
		shop_UserControls_ShowShop.ClassID = this.ClassID.SelectedValue;
		shop_UserControls_ShowShop.FrontIcon = this.FrontIcon.SelectedValue;
		shop_UserControls_ShowShop.OtherType = this.OtherType.SelectedValue;
		shop_UserControls_ShowShop.ShowFlag = this.ShowFlag.SelectedValue;
		shop_UserControls_ShowShop.ShowUIType = this.ShowUIType.SelectedValue;
		shop_UserControls_ShowShop.SortType = int.Parse(this.SortType.SelectedValue);
		DropDownList dropDownList = (DropDownList)this.HowaveProvinceCity1.FindControl("Province");
		DropDownList dropDownList2 = (DropDownList)this.HowaveProvinceCity1.FindControl("City");
		string text = "";
		if (dropDownList.SelectedIndex != 0)
		{
			text += dropDownList.SelectedValue;
			shop_UserControls_ShowShop.Product = text;
		}
		if (dropDownList2.SelectedIndex != 0)
		{
			text += dropDownList2.SelectedValue;
		}
		if (text != "")
		{
			shop_UserControls_ShowShop.ProductPlace = dropDownList2.SelectedValue;
		}
		if (this.ShowNum.Text != null && this.ShowNum.Text != "")
		{
			shop_UserControls_ShowShop.ShowNum = int.Parse(this.ShowNum.Text);
		}
		if (this.ShowNum.Text != null && this.ShowNum.Text != "")
		{
			shop_UserControls_ShowShop.ShowNum = int.Parse(this.ShowNum.Text);
		}
		if (this.TitleLength.Text != null && this.TitleLength.Text != "")
		{
			shop_UserControls_ShowShop.TitleLength = int.Parse(this.TitleLength.Text);
		}
		string text2 = "";
		foreach (ListItem listItem in this.ShowField.Items)
		{
			if (listItem.Selected)
			{
				text2 = text2 + listItem.Value + "|";
			}
		}
		if (text2.Contains("|"))
		{
			text2 = text2.Remove(text2.Length - 1);
		}
		shop_UserControls_ShowShop.ShowField = text2;
		string text3 = "";
		string seniorShop = "0";
		string bandShop = "0";
		foreach (ListItem listItem in this.Shop_ShopType.Items)
		{
			if (listItem.Selected)
			{
				text3 = text3 + listItem.Value + ",";
			}
		}
		if (text3.Length >= 2)
		{
			text3 = text3.Remove(text3.Length - 1);
		}
		shop_UserControls_ShowShop.CommondShop = text3;
		shop_UserControls_ShowShop.BandShop = bandShop;
		shop_UserControls_ShowShop.SeniorShop = seniorShop;
		this.LabelPreviewContent.Text = shop_UserControls_ShowShop.GetStrFromControl();
		this.LabelPreviewPanel.Visible = true;
	}
	protected void ProductPreview()
	{
		Shop_UserControls_ShowProduct shop_UserControls_ShowProduct = new Shop_UserControls_ShowProduct();
		if (this.ClassID.SelectedIndex != 0)
		{
			shop_UserControls_ShowProduct.ClassID = this.ClassID.SelectedValue;
		}
		if (this.EndPrice.Text != null && this.EndPrice.Text != "")
		{
			shop_UserControls_ShowProduct.EndPrice = this.EndPrice.Text;
		}
		if (this.StrartPrice.Text != "" && this.StrartPrice.Text != null)
		{
			shop_UserControls_ShowProduct.StartPrice = this.StrartPrice.Text;
		}
		if (this.IDArray.Text != null && this.IDArray.Text != "")
		{
			shop_UserControls_ShowProduct.ProductIDArray = this.IDArray.Text;
		}
		shop_UserControls_ShowProduct.FrontIcon = this.FrontIcon.SelectedValue;
		if (this.IsNew.SelectedIndex == 0)
		{
			shop_UserControls_ShowProduct.SecondHand = "1";
			shop_UserControls_ShowProduct.IsNew = "1";
		}
		else
		{
			if (this.IsNew.SelectedValue == "secondhand")
			{
				shop_UserControls_ShowProduct.SecondHand = "1";
				shop_UserControls_ShowProduct.IsNew = "0";
			}
			if (this.IsNew.SelectedValue == "new")
			{
				shop_UserControls_ShowProduct.IsNew = "1";
				shop_UserControls_ShowProduct.SecondHand = "0";
			}
		}
		string standPrice = "0";
		string auction = "0";
		string teamBuy = "0";
		string promoteBuy = "0";
		foreach (ListItem listItem in this.ProductType.Items)
		{
			if (listItem.Selected)
			{
				string value = listItem.Value;
				if (value != null)
				{
					if (!(value == "1"))
					{
						if (!(value == "3"))
						{
							if (!(value == "2"))
							{
								if (value == "4")
								{
									promoteBuy = "1";
								}
							}
							else
							{
								auction = "1";
							}
						}
						else
						{
							teamBuy = "1";
						}
					}
					else
					{
						standPrice = "1";
					}
				}
			}
		}
		string text = "";
		foreach (ListItem listItem in this.ShowField.Items)
		{
			if (listItem.Selected)
			{
				text = text + listItem.Value + "|";
			}
		}
		if (text.Contains("|"))
		{
			text = text.Remove(text.Length - 1);
		}
		if (this.KeyValue != null && this.KeyValue.Text != "")
		{
			shop_UserControls_ShowProduct.KeyValue = this.KeyValue.Text;
		}
		if (this.TitleLength.Text != "")
		{
			shop_UserControls_ShowProduct.TitleLength = int.Parse(this.TitleLength.Text);
		}
		if (this.ShowNum.Text != "")
		{
			shop_UserControls_ShowProduct.ShowNum = int.Parse(this.ShowNum.Text);
		}
		DropDownList dropDownList = (DropDownList)this.HowaveProvinceCity1.FindControl("Province");
		DropDownList dropDownList2 = (DropDownList)this.HowaveProvinceCity1.FindControl("City");
		string text2 = "";
		if (dropDownList.SelectedIndex != 0)
		{
			string selectedValue = dropDownList.SelectedValue;
			text2 += dropDownList.SelectedValue;
		}
		if (dropDownList2.SelectedIndex != 0)
		{
			text2 += dropDownList2.SelectedValue;
		}
		if (text2 != "")
		{
			shop_UserControls_ShowProduct.ProductPlace = text2;
		}
		shop_UserControls_ShowProduct.OtherType = this.OtherType.SelectedValue;
		shop_UserControls_ShowProduct.ProductImgType = this.ProductImgType.SelectedValue;
		shop_UserControls_ShowProduct.StandPrice = standPrice;
		shop_UserControls_ShowProduct.Auction = auction;
		shop_UserControls_ShowProduct.TeamBuy = teamBuy;
		shop_UserControls_ShowProduct.PromoteBuy = promoteBuy;
		shop_UserControls_ShowProduct.SortType = int.Parse(this.SortType.SelectedValue);
		shop_UserControls_ShowProduct.ShowUIType = this.ShowUIType.SelectedValue;
		shop_UserControls_ShowProduct.ShowField = text;
		shop_UserControls_ShowProduct.ShowFlag = this.ShowFlag.SelectedValue;
		shop_UserControls_ShowProduct.OpenType = this.OpenType.SelectedValue;
		this.LabelPreviewContent.Text = shop_UserControls_ShowProduct.GetStrFromControl();
		this.LabelPreviewPanel.Visible = true;
	}
}
